package com.snail.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import com.aliyun.green20220302.Client;
import com.aliyun.green20220302.models.VideoModerationRequest;
import com.aliyun.green20220302.models.VideoModerationResponse;
import com.aliyun.green20220302.models.VideoModerationResponseBody;
import com.aliyun.teaopenapi.models.Config;

/**
 * @author Monica
 * @description
 * @date 2025/8/20 11:21
 */
@Component
public class AliYunGreenConfig {
    @Value("${aliyun.green.accessKeyId}")
    private String accessKeyId;
    @Value("${aliyun.green.accessKeySecret}")
    private String accessKeySecret;
    @Value("${aliyun.green.endpoint}")
    private String endpoint;
    @Value("${aliyun.green.regionId}")
    private String regionId;
    @Value("${aliyun.green.readTimeout}")
    private Integer readTimeout;
    @Value("${aliyun.green.connectTimeout}")
    private Integer connectTimeout;


    @Bean
    public Client aliyunGreenClient() throws Exception {
        Config config = new Config()
                .setAccessKeyId(accessKeyId)
                .setAccessKeySecret(accessKeySecret)
                .setEndpoint(endpoint)
                .setRegionId(regionId)
                .setReadTimeout(readTimeout)
                .setConnectTimeout(connectTimeout);
        return new Client(config);
    }


}
